package com.ticket.sass.admin.dto.output.config;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.ticket.sass.admin.model.KeyInfoModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;
import java.util.Objects;

/**
 * @author ywb
 * @date 2024-03-25 17:52
 */
@Data
@ApiModel
public class CinemaConfigOutput {
    @ApiModelProperty(value = "主键")
    private Long id;
    
    @ApiModelProperty(value = "影院名称")
    private String name;
    
    @ApiModelProperty(value = "影院简称")
    private String shortName;
    
    @ApiModelProperty(value = "影院地址")
    private String addr;
    
    @JsonIgnore
    @ApiModelProperty(value = "影院LOGO")
    private String logo;
    
    @ApiModelProperty(value = "影院LOGO")
    private KeyInfoModel logoModel;
    
    @ApiModelProperty(value = "地区编码")
    private String areaCode;
    
    @ApiModelProperty(value = "专资编码")
    private String zzCode;
    
    @ApiModelProperty(value = "经度")
    private Double lng;
    
    @ApiModelProperty(value = "纬度")
    private Double lat;
    
    @ApiModelProperty(value = "经纬度")
    private String point;
    
    @ApiModelProperty(value = "联系方式")
    private List<String> contact;
    
    @ApiModelProperty(value = "通知")
    private List<NoticesConfigOutput> notices;
    
    public KeyInfoModel getLogoModel() {
        if (Objects.isNull(logo)){
            return null;
        }
        
        return new KeyInfoModel(logo.toString());
    }
}
